package com.atguigu.common.exception;

/**
 * 商品没有库存自定义异常
 *
 * @author LaiSanShan
 * @date 2021-09-02
 */
public class NoStockException extends RuntimeException {

    // 商品id
    private Long skuId;

    // 订单号
    private String orderSn;

    public NoStockException(Long skuId) {
        super("商品id:" + skuId + "没有足够的库存");
    }

    public NoStockException(String orderSn) {
        super("订单号:" + orderSn + "没有足够的库存");
    }

    public Long getSkuId() {
        return skuId;
    }

    public void setSkuId(Long skuId) {
        this.skuId = skuId;
    }

    public String getOrderSn() {
        return orderSn;
    }

    public void setOrderSn(String orderSn) {
        this.orderSn = orderSn;
    }

}
